<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>

<html>
<head>
<meta charset="UTF-8">
<title>HTML5 채팅 VER.2</title>
<script>
window.onload = function() {
	var es = new EventSource("chat2_sel.jsp");
	
	var chat = document.getElementById("chat");
	es.onmessage = function(e){
		chat.innerHTML = chat.innerHTML + "<br />" + e.data;
	};
}
</script>
</head>
<body>
<div id="chat">
</div>
<hr />
<input type="text" name="chat_msg" /><input type="button" value="전송" />
</body>
</html>